package chapter12

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/23 22:33
  * @history:
  *          1.2019/1/23 created by chuhaitao
  */
object HighOrderDemo {


  def main(args: Array[String]): Unit = {

    def maxFun(x: Int) = {
      (y: Int) => x - y
    }

    val f1 = maxFun(3)
    println(f1(3)) //:   (y: Int) => 3 - y
    println(maxFun(3)(2)) //2-2


    List(1, 2, 34, 5).map(x => x + 1)
    List(1, 2, 34, 5).map(_ + 1)
  }


}
